<?php

abstract class Base_controller 
{
	/*
	 * Mysqli Instance 
	 */
	public $db;
	
	/*
	 * @registry object
	 */
	protected $registry;
	
	/*
	 * Instancia del controller
	 */
	private static $instance;
	
	function __construct($registry) 
	{
		self::$instance = &$this;

		$this->registry = $registry;
		
		$this->db = $registry->db;
	}
	
	/*
	 * Retorna la instancia actual del controller
	 */
	public static function &get_instance()
	{
		return self::$instance;
	}
	
	/**
	 * @all controllers must contain an index method
	 */
	abstract function index();
}

?>
